package com.pesilo.mvc.view.component.mediator
{
	import com.pesilo.mvc.controller.ApplicationFacade;
	import com.pesilo.mvc.view.component.module.navigationModule.NavigationComponent;
	
	import org.puremvc.as3.multicore.interfaces.IMediator;
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.patterns.mediator.Mediator;

	public class NavigationMediator extends Mediator implements IMediator
	{
		public static const NAME:String="NavigationMediator";
		public function NavigationMediator(viewComponent:Object=null)
		{
			super(NAME,viewComponent);
		}
		
		override public function listNotificationInterests():Array{
			return[
				ApplicationFacade.SET_WEATHER_EVENT,
			]
		}
		
		override public function handleNotification(notification:INotification):void{
			var data:Object=notification.getBody();
			
			switch(notification.getName()){
				case ApplicationFacade.SET_WEATHER_EVENT:
					view.setWeather(data.toString());
					break;
			}
		}
		
		protected function get view():NavigationComponent{
			return viewComponent as NavigationComponent; 
		}
	}
}